package edu.nyupoly.wzj;

/*
 *  Because there are only 2 kinds of players which inherit from this abstract class,
 *  I don't use the Factory Method here.
 */

public abstract class Player {
	
	protected String playerName;
	protected int attempt;  
	// to record how many moves this player has given
	protected Mark myMark;
	protected Player opponent;

	public Player(String name, Mark mark) {
		this.playerName = name;
		this.myMark = mark;
		this.attempt = 0;
	}
	
	public void setOpponent(Player other) {
		this.opponent = other;
	}
	
	public Player getOpponent() {
		return this.opponent;
	}
	
	public Mark getMark() {
		return this.myMark;
	}
	
	public String getName() {
		return this.playerName;
	}
	
	public void increaseAttempt() {
		this.attempt++;
	}
	
	public abstract void makeMove(Board b);
	
	public abstract boolean isWinner(Board b);

}

